/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hopes.bizz.risk.control.dto.RiskMeasureTaskDTO;
import com.hopes.bizz.risk.control.entity.RiskMeasureTaskConfigEntity;
import com.hopes.bizz.risk.control.entity.RiskMeasureTaskEntity;
import com.hopes.bizz.risk.control.vo.RiskMeasureTaskVO;
import com.hopes.bizz.risk.control.vo.RiskObjectVO;
import com.hopes.bizz.risk.statistic.dto.SafetyStatisticsDTO;

import java.util.Collection;
import java.util.List;

/**
 * 隐患排查任务设置
 *
 * @author pig
 * @date 2023-07-20 09:01:45
 */
public interface RiskMeasureTaskService extends IService<RiskMeasureTaskEntity> {

    Page<RiskMeasureTaskVO> listPage(Page<RiskMeasureTaskVO> page, RiskMeasureTaskDTO riskMeasureTaskDTO);

    /**
     * 批量删除
     * @param list  删除id集合
     * @return      结果
     */
    boolean removeBatchByIds(Collection<?> list);

    /**
     * 批量保存 隐患检查任务
     * @param measureTaskConfigEntity         任务配置
     * @param riskMeasureTaskList             任务列表
     */
    void batchSaveWithTaskConfig(RiskMeasureTaskConfigEntity measureTaskConfigEntity, List<RiskMeasureTaskEntity> riskMeasureTaskList);

    /**
     * 启动任务
     * @param list  list
     * @return    结果
     */
    boolean startTask(Collection<?> list);

    /**
     * 停止任务
     * @param list  list
     * @return    结果
     */
    boolean stopTask(Collection<?> list);

    // 统计接口
    Page<RiskObjectVO> taskStatistics(Page page, SafetyStatisticsDTO safetyStatisticsDto);

    /**
     * @Description 根据风险单元id列表查询管控措施
     * @Author lyb
     * @Date 2023/7/5
     **/
    List<RiskMeasureTaskEntity> getByRiskUnitIdList(List<Long> riskUnitIdList);
}
